
import { createApp, watch } from 'vue'
import { createPinia } from 'pinia'
import 'virtual:svg-icons-register'
import App from './App.vue'
import router from './router'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate';
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import ElementPlus from 'element-plus';//为vue3项目特别更新的版本
import 'element-plus/dist/index.css';
import component from './components/component'
import scrollDirective from '@/directive/scroll'
import { drag } from './directive/drag'
// animate动画库
import 'animate.css'
// 公共样式库
import '@/styles/index.scss'
// 将自动注册所有组件为全局组件




const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
app.use(createPinia().use(piniaPluginPersistedstate));
app.directive(scrollDirective.name, scrollDirective);
app.directive('drag', drag)
app.use(router);
app.use(ElementPlus);
app.use(component);

app.mount('#app');

